#pragma once
#include<stdio.h>
#include<time.h>
namespace ns_log
{

    
    enum
    {
        INFO, //就是整数
        DEBUG,
        WARNING,
        ERROR,
        FATAL
    };
 #define LOG_LEVEL INFO  


    #define LOg(level,format,...) do{\
    if (level < LOG_LEVEL) break;\
    time_t t=time(nullptr);\
      struct tm *ltm = localtime(&t);\
      char tmp[32] = {0};\
    strftime(tmp, 31, "%H:%M:%S", ltm);\
    fprintf(stdout,"[%s] [%s,%s:%d]" format "\n",#level,tmp, __FILE__, __LINE__, ##__VA_ARGS__);\
    }while(0)


    #define INFO_Log(format,...) LOg(INFO,format,##__VA_ARGS__)
    #define DBG_Log(format,...) LOg(DEBUG,format, ##__VA_ARGS__)
    #define ERR_Log(format,...) LOg( ERROR,format, ##__VA_ARGS__)
    #define WARING_Log(format,...) LOg(WARNING,format,##__VA_ARGS__)
    #define FATAL_Log(format,...) LOg(FATAL,format,##__VA_ARGS__)


}

